package router

import (
	"ginstudydemo.com/main/controllers"
	"ginstudydemo.com/main/middleware"
	"github.com/gin-gonic/gin"
)

// DictRouter 函数定义了 字典 路由组及其处理函数
func DictRouter(r *gin.Engine) {
	rGroup := r.Group("/dict")
	{

		// 字典列表
		rGroup.GET("/page", middleware.NewJwtV5().JWTAuth(), controllers.NewDictController().GetDictPage)

		//// 字典下拉列表
		//rGroup.GET("/options", middleware.NewJwtV5().JWTAuth(), controllers.NewDeptController().GetDeptOptions)

		//// 字典表单数据
		rGroup.GET("/:id/form", middleware.NewJwtV5().JWTAuth(), controllers.NewDictController().GetDictForm)

		// 新增字典
		rGroup.POST("", middleware.NewJwtV5().JWTAuth(), controllers.NewDictController().AddDict)

		// 修改字典
		rGroup.PUT("/:id", middleware.NewJwtV5().JWTAuth(), controllers.NewDictController().EditDict)

		// 删除字典
		rGroup.DELETE("/:ids", middleware.NewJwtV5().JWTAuth(), controllers.NewDictController().DelDict)

	}

}
